package com.csun.cmny.provider.model.dto.device;

import com.csun.cmny.provider.validator.DmcDeviceAddValidator;
import com.csun.cmny.provider.validator.DmcDeviceEditValidator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * @Auther: chisj chisj@foxmal.com
 * @Date: 2017-03-01 20:12
 * @Description:
 */
@Data
@ApiModel(value = "设备新增Dto")
public class DmcEditDeviceDto implements Serializable {

    private static final long serialVersionUID = -8471235927389653236L;

    @ApiModelProperty(value = "设备Id", required = true)
    @NotNull(message = "{device.id.null}",
            groups = {DmcDeviceEditValidator.class})
    private Long id;

    @ApiModelProperty(value = "设备类型", required = true)
    @NotNull(message = "{device.type.empty}",
            groups = {DmcDeviceAddValidator.class})
    @Range(min = 0, max = 10, message = "{device.type.range}",
            groups = {DmcDeviceAddValidator.class})
    private Integer deviceType;

    @NotNull(message = "{device.no.empty}")
    @NotEmpty(message = "{device.no.empty}")
    @ApiModelProperty(value = "设备编号", required = true)
    private String deviceNo;

    @ApiModelProperty(value = "设备名称")
    private String deviceName;

    @ApiModelProperty(value = "设备描述信息")
    private String remark;

}
